package com.bcbim.smart_water.health.mapper;

import com.bcbim.smart_water_interface.health.bo.HealthBO;
import com.bcbim.smart_water_interface.health.bo.UpdateFlawLatLonBO;
import com.bcbim.smart_water_interface.health.dao.FlawDO;
import com.bcbim.smart_water_interface.health.dto.*;
import com.bcbim.smart_water_interface.health.vo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 健康检测mapper
 * @Author: ye
 * @Date: 2021/8/27
 * @Version: V1.0
 **/
@Mapper
public interface HealthMapper {

    /**
     * @Description: 健康监测总数
     * @Param: ListHealthDto
     * @Return: int
     * @Author: ye
     * @Date: 2021/8/27
     */
    int countHealth(ListHealthDTO query);

    /**
     * @Description: 健康检测列表
     * @Param: ListHealthDto
     * @Return: List<HealthVO>
     * @Author: ye
     * @Date: 2021/8/27
     */
    List<HealthVO> listHealth(ListHealthDTO query);

    /**
     * @Description: 健康检测信息
     * @Param: healthId
     * @Return: HealthInfoVo
     * @Author: ye
     * @Date: 2021/8/30
     */
    HealthInfoVO getHealthInfoByHealthId(String healthId);

    /**
     * @Description: 缺陷信息
     * @Param: healthId
     * @Return: List<FlawInfoVo>
     * @Author: ye
     * @Date: 2021/8/30
     */
    List<FlawInfoVO> getFlawInfoByHealthId(String healthId);

    /**
     * @Description: 功能性缺陷信息
     * @Param: healthId
     * @Return: DefectLevelVO
     * @Author: ye
     * @Date: 2021/8/30
     */
    DefectLevelVO getHealthDefect(@Param("healthId") String healthId, @Param("defectType") String defectType);

    /**
     * @Description: 更新缺陷位置所需信息
     * @Param:
     * @Return: List<UpdateFlawLatLonBO>
     * @Author: ye
     * @Date: 2021/9/2
     */
    List<UpdateFlawLatLonBO> getUpdateFlawLatLon();

    /**
     * @Description: 更新位置
     * @Param:
     * @Return: List<UpdateFlawLatLonDTO>
     * @Author: ye
     * @Date: 2021/9/2
     */
    void updateFlawLocation(@Param("list") List<UpdateFlawLatLonDTO> update);

    /**
     * @Description: 查询地图上结构缺陷位置信息
     * @Param: FlawLocationDTO
     * @Return: List<FlawLocationVO>
     * @Author: ye
     * @Date: 2021/9/2
     */
    List<FlawLocationVO> listStructuralFlawLocation(FlawLocationDTO query);
    /**
     * @Description: 查询地图上结构缺陷位置信息
     * @Param: FlawLocationDTO
     * @Return: List<FlawLocationVO>
     * @Author: ye
     * @Date: 2021/9/2
     */
    List<FlawLocationVO> listFunctionalFlawLocation(FlawLocationDTO query);

    /**
     * @Description: 管线健康监测信息
     * @Param: line
     * @Return: HealthInfoVO
     * @Author: ye
     * @Date: 2021/9/16
     */
    HealthInfoVO getHealthByLineId(String lineId);

    /**
     * @Description: 管线缺陷信息
     * @Param: lineId
     * @Return: List<FlawLocationVO>
     * @Author: ye
     * @Date: 2021/9/16
     */
    List<FlawLocationVO> getFlawLocationByLineId(String lineId);

    /**
     * @Description: 查询健康检测id
     * @Param: ListHealthDTO
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/10/29
     */
    List<String> getHealthId(ListHealthDTO query);

    /**
     * @Description: 下载集总数
     * @Param: ListDownloadSetHealthDTO
     * @Return: int
     * @Author: ye
     * @Date: 2021/10/29
     */
    int countHealthDownloadSet(ListDownloadSetHealthDTO query);

    /**
     * @Description: 下载集列表
     * @Param: ListDownloadSetHealthDTO
     * @Return: List<HealthVO>
     * @Author: ye
     * @Date: 2021/10/29
     */
    List<HealthVO> listHealthDownloadSet(ListDownloadSetHealthDTO query);

    /**
     * @Description: 健康检测管理列表
     * @Param: ListHealthManagementDTO
     * @Return: int
     * @Author: ye
     * @Date: 2021/11/1
     */
    int countHealthManagement(ListHealthManagementDTO query);

    /**
     * @Description: 健康检测管理列表
     * @Param: ListHealthManagementDTO
     * @Return: List<HealthManagementVO>
     * @Author: ye
     * @Date: 2021/11/1
     */
    List<HealthManagementVO> listHealthManagement(ListHealthManagementDTO query);

    /**
     * @Description: 删除健康检测
     * @Param: healthId
     * @Return: int
     * @Author: ye
     * @Date: 2021/11/1
     */
    int removeHealth(String healthId);

    /**
     * @Description: 上传管壁全景图
     * @Param: UploadHealthImgDTO
     * @Return: ReturnMsg
     * @Author: ye
     * @Date: 2021/11/1
     */
    void uploadLineWallImg(UploadHealthImgDTO query);

    /**
     * @Description: 上传模型截面图
     * @Param: UploadHealthImgDTO
     * @Return: ReturnMsg
     * @Author: ye
     * @Date: 2021/11/1
     */
    void uploadLineSectionImg(UploadHealthImgDTO query);

    /**
     * @Description: 监控监测管理详情
     * @Param: String
     * @Return: HealthManagementInfoVO
     * @Author: ye
     * @Date: 2021/11/3
     */
    HealthManagementInfoVO getHealthManagementInfo(String healthId);

    /**
     * @Description: 健康监测缺陷管理详情
     * @Param: String
     * @Return: List<FlawManagementInfoVO>
     * @Author: ye
     * @Date: 2021/11/3
     */
    List<FlawManagementInfoVO> getFlawManagementInfo(String healthId);

    /**
     * @param healthManagementInfoVO
     * @Description: 编辑保存健康监测
     * @Param: HealthManagementInfoVO
     * @Return:
     * @Author: ye
     * @Date: 2021/11/3
     */
    void updateHealthInfo(HealthManagementInfoVO healthManagementInfoVO);

    /**
     * @Description: 编辑保存健康监测缺陷
     * @Param: List<FlawDO>
     * @Return:
     * @Author: ye
     * @Date: 2021/11/3
     */
    void insertFlawInfo(@Param("list") List<FlawDO> arrFlaw);

    /**
     * @Description: 清除健康监测缺陷
     * @Param: healthId
     * @Return:
     * @Author: ye
     * @Date: 2021/11/3
     */
    void clearHealthFlaw(String healthId);

    /**
     * @Description: 查询健康检测管线经纬度位置
     * @Param: healthId
     * @Return: UpdateFlawLatLonBO
     * @Author: ye
     * @Date: 2021/11/3
     */
    UpdateFlawLatLonBO getHealthLineLatLon(String healthId);

    /**
     * @Description:
     * @Param:
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    void removeLineHealth(String lineId);

    /**
     * @Description: 新建健康监测
     * @Param: HealthBO
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    void insertHealth(HealthBO health);

    /**
     * @Description: 保存健康监测视频
     * @Param: UploadHealthVideoDTO
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    void saveHealthVideo(UploadHealthVideoDTO videoDTO);

    /**
     * @param substring
     * @Description: 查询缺陷id
     * @Param:
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    String getDefectId(String substring);

    /**
     * @Description: 查询w缺陷等级
     * @Param:
     * @Return:
     * @Author: ye
     * @Date: 2021/11/13
     */
    String getDefectLevelId(@Param("defectId") String defectId, @Param("level") String level);
}
